import request from '@/utils/request'

// 获取可申请的奖学金列表
export function getScholarships(params) {
  const { page = 0, size = 10 } = params || {}
  return request({
    url: '/api/student/scholarships',
    method: 'get',
    params: {
      page,
      size
    }
  })
}

// 提交奖学金申请
export function submitApplication(data) {
  return request({
    url: '/api/student/scholarship-applications',
    method: 'post',
    data
  })
}

// 获取我的申请列表
export function getMyApplications(params) {
  const { page = 0, size = 10, status } = params || {}
  return request({
    url: '/api/student/scholarship-applications',
    method: 'get',
    params: {
      page,
      size,
      status
    }
  })
}

// 撤回申请
export function withdrawApplication(id) {
  return request({
    url: `/api/student/scholarship-applications/${id}/withdraw`,
    method: 'post'
  })
} 